const db = wx.cloud.database()

export const all = async (database) => {
  return await db.collection(database).get()
}

export const add = async (database, data)=>{
  return await db.collection(database).add({data})
}

export const del = async (database, id)=>{
  return await db.collection(database).where({ _id: id }).remove()
}